package a.f.h.f.a;

import a.a.fb;
import a.c.ab;
import a.c.m;
import a.c.q;
import a.f.j.cb;
import a.f.j.i;

import java.util.List;

public class d
{
  private cb a;
  private e b;
  private a.c.e c;
  private a.c.e d;
  private a.c.n e = null;
  private a.c.n f = null;
  public static boolean g;
  
  public d(cb paramcb, e parame, a.c.e parame1, a.c.e parame2)
  {
    this.a = paramcb;
    this.b = parame;
    this.c = parame1;
    this.d = parame2;
  }
  
  public void a(a.c.n paramn)
  {
    this.e = paramn;
  }
  
  public void c(a.c.n paramn)
  {
    this.f = paramn;
  }
  
  protected ab a(a.c.d paramd, ab paramab1, ab paramab2)
  {
    int m = e.i;
    boolean bool = e.h;
    Object localObject1 = null;
    Object localObject2 = null;
    a.i.n.a(this, 0, "Create Routing graph: ");
    n localn = new n(this.a, this.b);
    localn.a(this.e);
    localn.c(this.f);
    localn.a(paramd, paramab1);
    q localq = localn.a();
    int i = localn.l(paramd.e());
    int j = localn.l(paramd.f()) - 1;
    a.c.e locale1 = localq.i();
    localn.a(locale1, "S" + i);
    a.c.e locale2 = localq.i();
    localn.a(locale2, "E" + j);
    a.c.n localn1 = localq.C();
    a.i.n.a(this, 0, "Connect start and endnode: ");
    Object localObject3 = paramd.e().n();
    int k;
    while (((m)localObject3).e())
    {
      localObject4 = this.a.c(((m)localObject3).a());
      localObject5 = localn.u(((m)localObject3).a());
      if (m == 0)
      {
        if (localn.d((a.f.j.n)localObject4) <= i)
        {
          if (m != 0) {
            break label420;
          }
          if (localn.d((a.f.j.n)localObject4) + ((List)localObject5).size() > i)
          {
            k = i - localn.d((a.f.j.n)localObject4);
            localObject6 = localq.a(locale1, (a.c.e)((List)localObject5).get(k));
            localn.a((a.c.d)localObject6, 0.0D);
            localn1.a(localObject6, ((m)localObject3).a());
            if (m != 0) {
              break label418;
            }
            if (paramd.e() == this.c)
            {
              if (m != 0) {
                break label420;
              }
              if (localn.a((List)localObject5))
              {
                localObject1 = localObject6;
                locald2 = localq.a(locale1, (a.c.e)localn.b((List)localObject5).get(k));
                localn.a(locald2, 0.0D);
                localn1.a(locald2, ((m)localObject3).a());
              }
            }
          }
        }
        ((m)localObject3).f();
      }
      label418:
      if (bool)
      {
        label420:
        if (m == 0) {}
        q.n = !q.n;
      }
    }
    localObject3 = paramd.f().n();
    if (((m)localObject3).e()) {}
    label692:
    label694:
    while (m != 0)
    {
      localObject4 = this.a.c(((m)localObject3).a());
      localObject5 = localn.u(((m)localObject3).a());
      if ((m == 0) && (bool)) {
        break label709;
      }
      if (m == 0)
      {
        if (localn.d((a.f.j.n)localObject4) <= j)
        {
          if (m != 0) {
            break label694;
          }
          if (localn.d((a.f.j.n)localObject4) + ((List)localObject5).size() > j)
          {
            k = j - localn.d((a.f.j.n)localObject4);
            localObject6 = localq.a((a.c.e)((List)localObject5).get(k), locale2);
            localn.a((a.c.d)localObject6, 0.0D);
            localn1.a(localObject6, ((m)localObject3).a());
            if (m != 0) {
              break label692;
            }
            if (paramd.f() == this.d)
            {
              if (m != 0) {
                break label694;
              }
              if (localn.a((List)localObject5))
              {
                localObject2 = localObject6;
                locald2 = localq.a((a.c.e)localn.b((List)localObject5).get(k), locale2);
                localn.a(locald2, 0.0D);
                localn1.a(locald2, ((m)localObject3).a());
              }
            }
          }
        }
        ((m)localObject3).f();
      }
      if (!bool) {
        break;
      }
    }
    a.i.n.a(this, 0, "Calculate shortest path: ");
    label709:
    localObject3 = fb.a(localq, locale1, locale2, true, localn.s());
    Object localObject4 = new ab();
    Object localObject5 = ((ab)localObject3).l();
    do
    {
      if (!((m)localObject5).e()) {
        break;
      }
      locald1 = localn.s(((m)localObject5).a());
      if (m == 0)
      {
        if (locald1 != null)
        {
          ((ab)localObject4).add(locald1);
          a.i.n.a(this, 0, "Cross Edge: " + locald1);
        }
        ((m)localObject5).f();
      }
    } while (!bool);
    localObject5 = new i(this.a);
    a.c.d locald1 = (a.c.d)localn1.get(((ab)localObject3).m());
    Object localObject6 = paramd.e().b(locald1);
    ((m)localObject6).c();
    a.c.d locald2 = this.a.b(((m)localObject6).a());
    locald1 = (a.c.d)localn1.get(((ab)localObject3).n());
    localObject6 = paramd.f().b(locald1);
    ((m)localObject6).c();
    a.c.d locald3 = this.a.b(((m)localObject6).a());
    ab localab = ((i)localObject5).a((ab)localObject4, locald2, locald3, paramd);
    localq.a(localn1);
    a.c.d locald4;
    if (m == 0)
    {
      if (((ab)localObject3).m() == localObject1)
      {
        locald4 = localab.m();
        if (m == 0)
        {
          if (locald4.e() == this.c)
          {
            if (m != 0) {
              break label1036;
            }
            this.b.c(this.c, locald4);
          }
        }
        else {
          if (!bool) {
            break label1039;
          }
        }
        label1036:
        this.b.c(this.c, this.a.b(locald4));
      }
      label1039:
      if (m != 0) {}
    }
    else
    {
      if (((ab)localObject3).n() == localObject2)
      {
        locald4 = localab.n();
        if (m == 0)
        {
          if (locald4.e() == this.d) {
            this.b.a(this.d, locald4);
          }
        }
        else
        {
          if (m != 0) {
            break label1158;
          }
          if (!bool) {
            break label1121;
          }
        }
        this.b.a(this.d, this.a.b(locald4));
      }
      label1121:
      this.a.e();
      this.a.a(this.a.c(this.b.b(this.c)));
      localn.i();
    }
    label1158:
    if (m != 0) {
      q.o = !q.o;
    }
    return localObject4;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.h.f.a.d

 * JD-Core Version:    0.7.0.1

 */